<template>
  <el-card>
    <el-table :data="permissionList" border row-key="id" :expand-row-keys="[1]">
      <el-table-column label="名称" prop="name" ></el-table-column>
      <el-table-column label="权限值" prop="code"></el-table-column>
      <el-table-column label="跳转权限值" align="center" prop="toCode"></el-table-column>
      <el-table-column label="操作" align="center"> 
        <template #default="{row,$index}">
          <el-button class="mr_20" type="primary" icon="el-icon-plus"></el-button>
          <el-button class="mr_20" type="primary" icon="el-icon-edit"></el-button>
          <el-button class="mr_20" type="danger" icon="el-icon-delete"></el-button>
        </template>
      </el-table-column>
    </el-table>
  </el-card>
</template>

<script>
import { getPermissionList } from "@/api/pro/usePermission";
export default {
  name: "Permission",
  data() {
    return {
      permissionList: [],
    };
  },
  methods: {
    async setPermissionList() {
      try {
        let result = await getPermissionList();
        console.log(result.data.children);
        this.permissionList = result.data.children;
      } catch (error) {
        console.log(error);
      }
    },
  },
  mounted() {
    this.setPermissionList();
  },
};
</script>

<style>
</style>